package com.lz.blog.controller;

import com.lz.blog.service.LoginService;
import com.lz.blog.vo.Result;
import com.lz.blog.vo.params.LoginParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 登录功能
 *
 * @author Liz
 * @date 2023/02/13 15:20
 **/
@RestController
@RequestMapping("/login")
public class LoginController {
//    @Autowired
//    private SysUserService sysUserService;

    @Autowired
    private LoginService loginService;

    @PostMapping
    public Result login(@RequestBody LoginParam loginParam) {
        //登录，验证用户，访问用户表
        return loginService.login(loginParam);
    }
}
